unit QRelLancamentoEstoque;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, DB, DBTables, QRCtrls, QuickRpt, ExtCtrls;

type
  TFormQRelLancamentoEstoque = class(TForm)
    QuickRep1: TQuickRep;
    QRBand1: TQRBand;
    QRTitulo: TQRLabel;
    QRLabel1: TQRLabel;
    QRSysData1: TQRSysData;
    QRLabel2: TQRLabel;
    QRSysData2: TQRSysData;
    QRLabel3: TQRLabel;
    QRLabel4: TQRLabel;
    QRLabel5: TQRLabel;
    QRLabel6: TQRLabel;
    QRLabel7: TQRLabel;
    QRLabel9: TQRLabel;
    QRShape1: TQRShape;
    QRLabelPeriodo: TQRLabel;
    QRLabel10: TQRLabel;
    QRBand2: TQRBand;
    QRDBText1: TQRDBText;
    QRDBText2: TQRDBText;
    QRDBText3: TQRDBText;
    QRDBText4: TQRDBText;
    QRDBText5: TQRDBText;
    QRDBText6: TQRDBText;
    QRDBText7: TQRDBText;
    QRBand3: TQRBand;
    QRLabel8: TQRLabel;
    QRShape2: TQRShape;
    QueryLancamento: TQuery;
    QueryLancamentofornecedor: TStringField;
    QueryLancamentoingrediente: TStringField;
    QueryLancamentoid: TIntegerField;
    QueryLancamentoid_fornecedor: TIntegerField;
    QueryLancamentoid_ingrediente: TIntegerField;
    QueryLancamentoid_unidade: TIntegerField;
    QueryLancamentoquantidade: TFloatField;
    QueryLancamentodt_lancamento: TDateTimeField;
    QueryLancamentoid_tp_lancamento: TIntegerField;
    QueryLancamentoid_st_lancamento: TIntegerField;
    QueryLancamentovl_unitario: TFloatField;
    QueryLancamentovl_total: TFloatField;
    QueryLancamentonr_nota: TStringField;
    QueryLancamentoid_produto: TIntegerField;
    QueryLancamentoobs: TStringField;
    procedure QueryLancamentoquantidadeGetText(Sender: TField;
      var Text: String; DisplayText: Boolean);
    procedure QueryLancamentovl_unitarioGetText(Sender: TField;
      var Text: String; DisplayText: Boolean);
    procedure QueryLancamentovl_totalGetText(Sender: TField;
      var Text: String; DisplayText: Boolean);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  FormQRelLancamentoEstoque: TFormQRelLancamentoEstoque;

implementation

{$R *.dfm}

procedure TFormQRelLancamentoEstoque.QueryLancamentoquantidadeGetText(
  Sender: TField; var Text: String; DisplayText: Boolean);
begin

if QueryLancamento.RecordCount = 0 then
   abort;

try
 StrtoFloat(Trim(QueryLancamento.fieldByName('quantidade').AsString));
 Text := formatfloat('###,###,###0.000', StrToFloat(QueryLancamento.fieldByName('quantidade').AsString));
except
 abort;
end;

end;

procedure TFormQRelLancamentoEstoque.QueryLancamentovl_unitarioGetText(
  Sender: TField; var Text: String; DisplayText: Boolean);
begin
if QueryLancamento.RecordCount = 0 then
   abort;

try
 StrtoFloat(Trim(QueryLancamento.fieldByName('vl_unitario').AsString));
 Text := 'R$ ' + formatfloat('###,###,##0.00', StrToFloat(QueryLancamento.fieldByName('vl_unitario').AsString));
except
 abort;
end;
end;

procedure TFormQRelLancamentoEstoque.QueryLancamentovl_totalGetText(
  Sender: TField; var Text: String; DisplayText: Boolean);
begin

if QueryLancamento.RecordCount = 0 then
   abort;

try
 StrtoFloat(Trim(QueryLancamento.fieldByName('vl_total').AsString));
 Text := 'R$ ' + formatfloat('###,###,##0.00', StrToFloat(QueryLancamento.fieldByName('vl_total').AsString));
except
 abort;
end;



end;

end.
